#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QMainWindow>
#include <QMouseEvent>


#include "thread.h"
#include "admin.h"
#include "admindialog.h"
#include "keyboard.h"

namespace Ui {
class Widget;
}

class Widget : public QMainWindow
{
    Q_OBJECT

public:
    enum Choose_t{
        NAME,
        ID,
        PASSWD,
        PHONE,
    };

    explicit Widget(QMainWindow *parent = 0);
    ~Widget();

    bool eventFilter(QObject *watched, QEvent *event)override;
    void mouseReleaseEvent(QMouseEvent *)override;

private:
    Ui::Widget *ui;
    int user = 1;

    bool isShowUser = false;
    Admin *admin;
    bool isFocus = true;
    Choose_t choose = NAME;
    KeyBoard *key;
public slots:

    void deleteBtn_click();
    void keyPress(QString ch);
private slots:
    void on_login_pushButton_clicked();
    void on_regist_pushButton_clicked();
    void on_admin_pushButton_clicked();
};

#endif // WIDGET_H
